<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.1.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/hexo/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/hexo/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/hexo/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/hexo/images/logo.svg" color="#222">

<link rel="stylesheet" href="/hexo/css/main.css">


<link rel="stylesheet" href="/hexo/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"youchen12138.gitee.io","root":"/hexo/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="集中式版本控制系统：版本库是集中存放在中央服务器的，而干活的时候，用的都是自己的电脑，所以要先从中央服务器取得最新的版本，然后开始干活，干完活了，再把自己干的活推送到中央服务器。  分布式版本控制系统： 无中央服务器,每个人的电脑都是一个完整的版本库。  工作时无需联网。  在多人修改同一文件后，只需将各自的修改推送给对方，就可以无限看到对方的修改。  安全性高，因为每个人电脑上都有完整的版本库。">
<meta property="og:type" content="article">
<meta property="og:title" content="Git简介">
<meta property="og:url" content="https://youchen12138.gitee.io/hexo/2019/03/15/Git%E7%AE%80%E4%BB%8B/index.html">
<meta property="og:site_name" content="幽辰的博客">
<meta property="og:description" content="集中式版本控制系统：版本库是集中存放在中央服务器的，而干活的时候，用的都是自己的电脑，所以要先从中央服务器取得最新的版本，然后开始干活，干完活了，再把自己干的活推送到中央服务器。  分布式版本控制系统： 无中央服务器,每个人的电脑都是一个完整的版本库。  工作时无需联网。  在多人修改同一文件后，只需将各自的修改推送给对方，就可以无限看到对方的修改。  安全性高，因为每个人电脑上都有完整的版本库。">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="http://www.nowamagic.net/librarys/images/201401/2014_01_03_06.jpg">
<meta property="og:image" content="http://www.nowamagic.net/librarys/images/201401/2014_01_03_07.jpg">
<meta property="article:published_time" content="2019-03-15T12:11:19.000Z">
<meta property="article:modified_time" content="2019-03-18T14:20:54.713Z">
<meta property="article:author" content="幽辰">
<meta property="article:tag" content="Git">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://www.nowamagic.net/librarys/images/201401/2014_01_03_06.jpg">

<link rel="canonical" href="https://youchen12138.gitee.io/hexo/2019/03/15/Git%E7%AE%80%E4%BB%8B/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'en'
  };
</script>

  <title>Git简介 | 幽辰的博客</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/hexo/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">幽辰的博客</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/hexo/" rel="section"><i class="fa fa-home fa-fw"></i>Home</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/hexo/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>Tags<span class="badge">23</span></a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/hexo/categories/" rel="section"><i class="fa fa-th fa-fw"></i>Categories<span class="badge">14</span></a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/hexo/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>Archives<span class="badge">127</span></a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="https://youchen12138.gitee.io/hexo/2019/03/15/Git%E7%AE%80%E4%BB%8B/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/hexo/images/avatar.jpg">
      <meta itemprop="name" content="幽辰">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="幽辰的博客">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Git简介
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2019-03-15 20:11:19" itemprop="dateCreated datePublished" datetime="2019-03-15T20:11:19+08:00">2019-03-15</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">Edited on</span>
                <time title="Modified: 2019-03-18 22:20:54" itemprop="dateModified" datetime="2019-03-18T22:20:54+08:00">2019-03-18</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/hexo/categories/Git/" itemprop="url" rel="index"><span itemprop="name">Git</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="集中式版本控制系统："><a href="#集中式版本控制系统：" class="headerlink" title="集中式版本控制系统："></a>集中式版本控制系统：</h2><p>版本库是集中存放在中央服务器的，而干活的时候，用的都是自己的电脑，所以要先从中央服务器取得最新的版本，然后开始干活，干完活了，再把自己干的活推送到中央服务器。</p>
<p><img src="http://www.nowamagic.net/librarys/images/201401/2014_01_03_06.jpg" alt="集中式版本控制简图"></p>
<h2 id="分布式版本控制系统："><a href="#分布式版本控制系统：" class="headerlink" title="分布式版本控制系统："></a>分布式版本控制系统：</h2><ul>
<li><p>无中央服务器,每个人的电脑都是一个完整的版本库。</p>
</li>
<li><p>工作时无需联网。</p>
</li>
<li><p>在多人修改同一文件后，只需将各自的修改推送给对方，就可以无限看到对方的修改。</p>
</li>
<li><p>安全性高，因为每个人电脑上都有完整的版本库。</p>
</li>
</ul>
<p><img src="http://www.nowamagic.net/librarys/images/201401/2014_01_03_07.jpg" alt="分布式版本控制简图"></p>
<h3 id="版本控制工具应该具有的功能"><a href="#版本控制工具应该具有的功能" class="headerlink" title="版本控制工具应该具有的功能"></a>版本控制工具应该具有的功能</h3><h4 id="1-协同修改"><a href="#1-协同修改" class="headerlink" title="1. 协同修改"></a>1. 协同修改</h4><ul>
<li>多人并行不悖的修改服务器端的同一文件。</li>
</ul>
<h4 id="2-数据备份"><a href="#2-数据备份" class="headerlink" title="2. 数据备份"></a>2. 数据备份</h4><ul>
<li>不仅保存目录和文件的当前状态，还能保存每一个提交过的历史状态。</li>
</ul>
<h4 id="3-版本管理"><a href="#3-版本管理" class="headerlink" title="3. 版本管理"></a>3. 版本管理</h4><ul>
<li><p>在保存每一个版本的文件信息的时候要做到不保存重复数据，以节约存储空间，提高运行效率。</p>
</li>
<li><p>这方面SVN采用的是增量式管理的方式，而Git采用了<a target="_blank" rel="noopener" href="https://zhidao.baidu.com/question/68685918.html">文件系统快照</a>的方式。</p>
</li>
<li><p>增量式管理：只保存增加的那一点，需要时将增加的与原来的文件拼接。</p>
</li>
</ul>
<h4 id="4-权限控制"><a href="#4-权限控制" class="headerlink" title="4. 权限控制"></a>4. 权限控制</h4><ul>
<li><p>对团队中参与开发的人员进行权限控制。</p>
</li>
<li><p>对团队外开发者贡献的代码进行审核（Git独有）</p>
</li>
</ul>
<h4 id="5-历史记录"><a href="#5-历史记录" class="headerlink" title="5. 历史记录"></a>5. 历史记录</h4><ul>
<li><p>查看修改人、修改时间、修改内容、日志信息。</p>
</li>
<li><p>将本地文件恢复到某一个历史状态。</p>
</li>
</ul>
<h4 id="6-分支管理"><a href="#6-分支管理" class="headerlink" title="6. 分支管理"></a>6. 分支管理</h4><ul>
<li>允许开发团队在工作过程中多条生产线同时推进任务，进一步提高效率。</li>
</ul>
<h3 id="集中式和分布式的主要区别"><a href="#集中式和分布式的主要区别" class="headerlink" title="集中式和分布式的主要区别"></a><a target="_blank" rel="noopener" href="https://www.cnblogs.com/wx1993/p/7680877.html">集中式和分布式的主要区别</a></h3><h2 id="版本控制介绍"><a href="#版本控制介绍" class="headerlink" title="版本控制介绍"></a>版本控制介绍</h2><h3 id="版本控制"><a href="#版本控制" class="headerlink" title="版本控制"></a>版本控制</h3><p>工程设计领域中使用版本控制管理工程蓝图的设计过程。在IT开发过程也可以使用版本控制思想管理代码的版本迭代。</p>
<h3 id="Git的优势"><a href="#Git的优势" class="headerlink" title="Git的优势"></a>Git的优势</h3><ul>
<li><p>大部分操作在本地完成，不需要联网</p>
</li>
<li><p>完整性保证</p>
</li>
<li><p>尽可能添加数据而不是删除或修改数据</p>
</li>
<li><p>分支操作非常快捷流畅</p>
</li>
<li><p>与Linux命令全面兼容</p>
</li>
</ul>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/hexo/tags/Git/" rel="tag"># Git</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item"></div>
      <div class="post-nav-item">
    <a href="/hexo/2019/03/17/Git%E7%AC%94%E8%AE%B0/" rel="next" title="Git笔记">
      Git笔记 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E9%9B%86%E4%B8%AD%E5%BC%8F%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6%E7%B3%BB%E7%BB%9F%EF%BC%9A"><span class="nav-number">1.</span> <span class="nav-text">集中式版本控制系统：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%88%86%E5%B8%83%E5%BC%8F%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6%E7%B3%BB%E7%BB%9F%EF%BC%9A"><span class="nav-number">2.</span> <span class="nav-text">分布式版本控制系统：</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6%E5%B7%A5%E5%85%B7%E5%BA%94%E8%AF%A5%E5%85%B7%E6%9C%89%E7%9A%84%E5%8A%9F%E8%83%BD"><span class="nav-number">2.1.</span> <span class="nav-text">版本控制工具应该具有的功能</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#1-%E5%8D%8F%E5%90%8C%E4%BF%AE%E6%94%B9"><span class="nav-number">2.1.1.</span> <span class="nav-text">1. 协同修改</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-%E6%95%B0%E6%8D%AE%E5%A4%87%E4%BB%BD"><span class="nav-number">2.1.2.</span> <span class="nav-text">2. 数据备份</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-%E7%89%88%E6%9C%AC%E7%AE%A1%E7%90%86"><span class="nav-number">2.1.3.</span> <span class="nav-text">3. 版本管理</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#4-%E6%9D%83%E9%99%90%E6%8E%A7%E5%88%B6"><span class="nav-number">2.1.4.</span> <span class="nav-text">4. 权限控制</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#5-%E5%8E%86%E5%8F%B2%E8%AE%B0%E5%BD%95"><span class="nav-number">2.1.5.</span> <span class="nav-text">5. 历史记录</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#6-%E5%88%86%E6%94%AF%E7%AE%A1%E7%90%86"><span class="nav-number">2.1.6.</span> <span class="nav-text">6. 分支管理</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%9B%86%E4%B8%AD%E5%BC%8F%E5%92%8C%E5%88%86%E5%B8%83%E5%BC%8F%E7%9A%84%E4%B8%BB%E8%A6%81%E5%8C%BA%E5%88%AB"><span class="nav-number">2.2.</span> <span class="nav-text">集中式和分布式的主要区别</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6%E4%BB%8B%E7%BB%8D"><span class="nav-number">3.</span> <span class="nav-text">版本控制介绍</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6"><span class="nav-number">3.1.</span> <span class="nav-text">版本控制</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Git%E7%9A%84%E4%BC%98%E5%8A%BF"><span class="nav-number">3.2.</span> <span class="nav-text">Git的优势</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="幽辰"
      src="/hexo/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">幽辰</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/hexo/archives/">
        
          <span class="site-state-item-count">127</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/hexo/categories/">
          
        <span class="site-state-item-count">14</span>
        <span class="site-state-item-name">categories</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/hexo/tags/">
          
        <span class="site-state-item-count">23</span>
        <span class="site-state-item-name">tags</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">幽辰</span>
</div>
  <div class="powered-by">Powered by <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a>
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/hexo/lib/anime.min.js"></script>
  <script src="/hexo/lib/velocity/velocity.min.js"></script>
  <script src="/hexo/lib/velocity/velocity.ui.min.js"></script>

<script src="/hexo/js/utils.js"></script>

<script src="/hexo/js/motion.js"></script>


<script src="/hexo/js/schemes/pisces.js"></script>


<script src="/hexo/js/next-boot.js"></script>




  















  

  

</body>
</html>
